package com.hank.activemq.spring;

import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/***
 * 创建消息监听服务
 */
public class QueueMessageListener implements MessageListener {

    @Override
    public void onMessage(Message message) {
        TextMessage textMessage=(TextMessage)message;
        try{
            System.out.println("QueueMessageListener收到消息:"+textMessage.getText());
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
